<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>玩转spring boot——结合redis</title>
<script src="//cdn.bootcss.com/angular.js/1.5.6/angular.min.js"></script>
<script type="text/javascript">
    /*<![CDATA[*/
    var app = angular.module('app', []);
    app.controller('MainController', function($rootScope, $scope, $http) {

        $scope.value = '刘冬';
        $scope.id = '123456';

        //保存
        $scope.setString = function() {
            $http({
                url : '/setString?value=' + $scope.value,
                method : 'POST'
            });
        }

        $scope.getString = function() {
            $http({
                url : '/getString',
                method : 'POST'
            }).success(function(r) {
                $scope.result = JSON.stringify(r)
            });
        }
        $scope.getOrder = function() {
            $http({
                url : '/getRedis?id=' + $scope.id,
                method : 'POST'
            }).success(function(r) {
                $scope.result = JSON.stringify(r)
            });
        }
    });

    /*]]>*/
</script>
</head>
<body ng-app="app" ng-controller="MainController">
    <h1>玩转spring boot——结合redis</h1>
    <h4>
        <a href="http://www.cnblogs.com/GoodHelper/">from 刘冬的博客</a>
    </h4>
    <input type="text" ng-model="value" />
    <input type="button" value="设置" ng-click="setString()" />

    <br />
    <br />
    <input type="button" value="获取" ng-click="getString()" />
    <br />
    <br />
    <input type="text" ng-model="id" />
    <br />
    <input type="button" value="获取订单" ng-click="getOrder()" />
    <br />
    <br />
    <h3>结果：</h3>
    <p>{{result}}</p>


    <br />
    <a href="http://www.cnblogs.com/GoodHelper/">点击访问原版博客</a>
</body>
</html>